package com.bdqn.crm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bdqn.crm.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 */
public interface SysUserService extends IService<SysUser> {

    /**
     * 登录
     *
     * @return
     */
    SysUser login(String usrName, String usrPassword);

    /**
     * 分页查询所有角色数据
     *
     * @param usrName
     * @param roleId
     * @return
     */
    List<SysUser> selectPages(@Param("usrName") String usrName, @Param("roleId") Long roleId, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);


    /**
     * 登錄
     *
     * @param usrName
     * @param usrPassword
     * @return
     */
    List<SysUser> findUsersByUsrNameAndUsrPassword(String usrName, String usrPassword);

    /**
     * 根据用户名查询用户对象
     *
     * @param usrName
     * @return
     */
    SysUser findUserByUsrName(String usrName);

    /**
     * 输入明文密码得到密文密码
     * @param plaintextPassword
     * @return
     * @throws IllegalArgumentException
     */
    String encryptPassword(Object plaintextPassword) throws IllegalArgumentException;
}
